package atag.gui;
/*
 * NodeGraph.java
 *
 * Created on June 3, 2007, 1:49 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

/**
 *
 * @author Sirius
 */

import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;
import javax.swing.*;

public class NodeGraph extends Component{
    
    BufferedImage img;
    /** Creates a new instance of NodeGraph */
    public void paint(Graphics g) {
        g.drawImage(img, 0, 0, null);
    }
    
    public NodeGraph() {        
        try {
            img = ImageIO.read(new File("/media/D/Project/ToolkitModified/netbeans-project.h/src/atag/gui/sensornode.jpg"));
        } catch (IOException e) {
            System.out.println("image not /media/D/Project/ToolkitModified/netbeans-project.h/src/atag/gui/sensornode.jpg found");
        }
    }
    
        public Dimension getPreferredSize() {
        if (img == null) {
             return new Dimension(100,100);
        } else {
           return new Dimension(img.getWidth(null), img.getHeight(null));
       }
    }
    
}
